﻿Public NotInheritable Class frmSplashScreen
    Public Shared SplScreen As frmSplashScreen


    Public Shared Sub MySettingsIniLoad()
        Dim IniDat As String = My.Application.Info.DirectoryPath
        IniDat += "\Commander Wars.ini"
        If My.Computer.FileSystem.FileExists(IniDat) Then
            Using strR As New IO.StreamReader(IniDat, System.Text.Encoding.UTF8, True)
                While Not strR.EndOfStream
                    Dim z As String = strR.ReadLine
                    If z.Contains("//") Then z = z.Remove(z.IndexOf("//"))
                    z = z.Trim
                    If z = "" Then Continue While

                    'so und jetzt einfach alle Eigenschaften übernehmen..
                    If z.ToLower.StartsWith("ScreenWidth:".ToLower) Then
                        My.Settings.BildschirmBreite = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("ScreenHeight:".ToLower) Then
                        My.Settings.BildschirmHöhe = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Resourcepath:".ToLower) Then
                        My.Settings.Resourcenpfad = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Screen ratio:".ToLower) Then
                        My.Settings.Verhältnis = z.Remove(0, z.IndexOf(":") + 1)
                    End If

                    If z.ToLower.StartsWith("Stratch factor:".ToLower) Then
                        My.Settings.Streckfaktor = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Game Speed:".ToLower) Then
                        My.Settings.SpielGeschwindigkeit = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Scroll sensitivity:".ToLower) Then
                        My.Settings.ScrollEmpfindlichkeit = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Invert Mouse:".ToLower) Then
                        My.Settings.MausUmkehren = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Speech listening:".ToLower) Then
                        My.Settings.SprachZuhören = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Speech sensitivity:".ToLower) Then
                        My.Settings.SprachSensitivität = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Text Scroll speed:".ToLower) Then
                        My.Settings.Textfließgeschwindigkeit = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Autosave:".ToLower) Then
                        My.Settings.Autospeichern = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Last Game:".ToLower) Then
                        My.Settings.LetztesSpiel = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Battleanimations:".ToLower) Then
                        My.Settings.KampfAnimationen = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Captureanimations:".ToLower) Then
                        My.Settings.BesetzungsAnimation = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("LoadingTime:".ToLower) Then
                        My.Settings.DurchschnittlicheLadeZeit = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Language:".ToLower) Then
                        My.Settings.Sprache = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Autor:".ToLower) Then
                        My.Settings.Autor = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Music/Sound:".ToLower) Then
                        My.Settings.MusikSound = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Gamemode:".ToLower) Then
                        My.Settings.CommanderWarsGameMoodus = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("windowed:".ToLower) Then
                        My.Settings.Fenstermodus = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Fullscreen Width:".ToLower) Then
                        My.Settings.StandardVollbildschirmBreite = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Fullscreen Height:".ToLower) Then
                        My.Settings.StandardVollbildschirmHöhe = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Terrain style:".ToLower) Then
                        My.Settings.TerrainStyle = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("CoListAW:".ToLower) Then
                        My.Settings.COListAW = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("CoListSW2:".ToLower) Then
                        My.Settings.COListAW2 = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("CoListAWDC:".ToLower) Then
                        My.Settings.COListAWDC = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("CoListAWDS:".ToLower) Then
                        My.Settings.COListAWDS = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("CoListCoW:".ToLower) Then
                        My.Settings.COListCoW = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Unit List1:".ToLower) Then
                        My.Settings.EinheitenListe1 = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Unit List2:".ToLower) Then
                        My.Settings.EinheitenListe2 = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Unit List3:".ToLower) Then
                        My.Settings.EinheitenListe3 = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Record:".ToLower) Then
                        My.Settings.Aufzeichnen = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("InfoMenu:".ToLower) Then
                        My.Settings.InfoMenü = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("AutoResizeWindow:".ToLower) Then
                        My.Settings.AutoResizeWindow = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Taskbarmode:".ToLower) Then
                        My.Settings.TaskAnzeigenModus = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Background music:".ToLower) Then
                        My.Settings.Hintergrundmusik = z.Remove(0, z.IndexOf(":") + 1)
                    End If

                    'Script-Writer:
                    If z.ToLower.StartsWith("Script-Writer Size:".ToLower) Then
                        Dim l() As String = z.Remove(0, z.IndexOf(":") + 1).Split(";")
                        My.Settings.Größe = New Size(l(0).Trim, l(1).Trim)
                    End If
                    If z.ToLower.StartsWith("ShowInvalidCode:".ToLower) Then
                        My.Settings.ShowInvalidCode = z.Remove(0, z.IndexOf(":") + 1)
                    End If

                    '3D:
                    If z.ToLower.StartsWith("Quality:".ToLower) Then
                        My.Settings.TexturQuali = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("3D:".ToLower) Then
                        My.Settings.draw3D = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Paint everything:".ToLower) Then
                        My.Settings.TotalEinfärben = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Mouselighting:".ToLower) Then
                        My.Settings.Lichtmaus = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Animation Speed 3D:".ToLower) Then
                        My.Settings.AnimGeschw3D = z.Remove(0, z.IndexOf(":") + 1)
                    End If
                    If z.ToLower.StartsWith("Fog 3D:".ToLower) Then
                        My.Settings.Kriegsnebel3D = z.Remove(0, z.IndexOf(":") + 1)
                    End If

                    'Tasten:
                    If z.ToLower.StartsWith("Key Up:".ToLower) Then
                        My.Settings.Oben = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Down:".ToLower) Then
                        My.Settings.Unten = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Right:".ToLower) Then
                        My.Settings.Rechts = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Left:".ToLower) Then
                        My.Settings.Links = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If

                    If z.ToLower.StartsWith("Key Confirm:".ToLower) Then
                        My.Settings.Bestätigen = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Cancel:".ToLower) Then
                        My.Settings.Abrechen = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If

                    If z.ToLower.StartsWith("Key Next:".ToLower) Then
                        My.Settings.NächsteEinheit = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Select:".ToLower) Then
                        My.Settings.SelectTaste = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If

                    If z.ToLower.StartsWith("Key Quicksave1:".ToLower) Then
                        My.Settings.Quicksave1 = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Quicksave2:".ToLower) Then
                        My.Settings.Quicksave2 = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Quickload1:".ToLower) Then
                        My.Settings.Quickload1 = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key Quickload2:".ToLower) Then
                        My.Settings.Quickload2 = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If

                    If z.ToLower.StartsWith("Key Chat:".ToLower) Then
                        My.Settings.Chat = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If
                    If z.ToLower.StartsWith("Key TeamChat:".ToLower) Then
                        My.Settings.TChat = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If

                    If z.ToLower.StartsWith("Key change Battlefield:".ToLower) Then
                        My.Settings.Schlachtwechsel = [Enum].Parse(System.Windows.Forms.Keys.A.GetType, z.Remove(0, z.IndexOf(":") + 1))
                    End If


                End While
            End Using
            My.Settings.Save()
        End If
    End Sub
    Public Shared Sub MySettingsIniSave()
        Dim IniDat As String = My.Application.Info.DirectoryPath
        IniDat += "\Commander Wars.ini"

        Using strW As New IO.StreamWriter(IniDat, False, System.Text.Encoding.UTF8)

            strW.WriteLine("//The Ini-File stores all the values of the settings.")
            strW.WriteLine("//Feel free to edit it. The most of it, you can easily change in the option menu.")
            strW.WriteLine("//Some changes may have no effect, because they are overwritten if you start the game.")
            strW.WriteLine("//Some changes may make the game crash. That's why you should better make a copy before changing values.")
            strW.WriteLine("//If you delete this file, nothing will happen, because the values are NOT saved here. They are just overwritten by these values.")
            strW.WriteLine("//If you changed some values here, which make your game crash and you don't have a backup and just deleting this file doesn't help you, you can try to start the game with the Reset parameter. (Just click at ""help"" in the first little window)")
            strW.WriteLine("")
            'so und jetzt einfach alle Eigenschaften abspeichern..
            strW.WriteLine("//The Screen bounds")
            strW.WriteLine("ScreenWidth:" + My.Settings.BildschirmBreite.ToString)
            strW.WriteLine("ScreenHeight:" + My.Settings.BildschirmHöhe.ToString)
            strW.WriteLine("//Some values, which probably have no effect")
            strW.WriteLine("Resourcepath:" + My.Settings.Resourcenpfad.ToString)
            strW.WriteLine("Screen ratio:" + My.Settings.Verhältnis.ToString)
            strW.WriteLine("Stratch factor:" + My.Settings.Streckfaktor.ToString)
            strW.WriteLine("//increase this, to make everything faster. (You can't make it as fast as you want, of course. Just as slow as you want :))")
            strW.WriteLine("Game Speed:" + My.Settings.SpielGeschwindigkeit.ToString)
            strW.WriteLine("Scroll sensitivity:" + My.Settings.ScrollEmpfindlichkeit.ToString)
            strW.WriteLine("//Invert Mouse, just inverts the scroll-direction")
            strW.WriteLine("Invert Mouse:" + My.Settings.MausUmkehren.ToString)
            strW.WriteLine("//Speech Recognization - We just removed the link to it, so it won't happen anything, because a lot of your Computers (Win XP by default) haven't installed it. But it worked fine :)")
            strW.WriteLine("Speech listening:" + My.Settings.SprachZuhören.ToString)
            strW.WriteLine("Speech sensitivity:" + My.Settings.SprachSensitivität.ToString)
            strW.WriteLine("")
            strW.WriteLine("Text Scroll speed:" + My.Settings.Textfließgeschwindigkeit.ToString)
            strW.WriteLine("Autosave:" + My.Settings.Autospeichern.ToString)
            strW.WriteLine("Last Game:" + My.Settings.LetztesSpiel.ToString)
            strW.WriteLine("Battleanimations:" + My.Settings.KampfAnimationen.ToString)
            strW.WriteLine("Captureanimations:" + My.Settings.BesetzungsAnimation.ToString)
            strW.WriteLine("//The Loading Time in Ticks per Player :) The progressbar just moves because of this value. It stores, how long it needs to load 1 Player and save this.")
            strW.WriteLine("LoadingTime:" + My.Settings.DurchschnittlicheLadeZeit.ToString)
            strW.WriteLine("//Language: 0=German 1=English")
            strW.WriteLine("Language:" + My.Settings.Sprache.ToString)
            strW.WriteLine("//Autor is the name, displayed, if you make maps in the editor. If you play a multiplayer game, this name is used too. Just enter your nickname")
            strW.WriteLine("Autor:" + My.Settings.Autor.ToString)
            strW.WriteLine("//Here you can mute everything")
            strW.WriteLine("Music/Sound:" + My.Settings.MusikSound.ToString)
            strW.WriteLine("//Just the music of the COs")
            strW.WriteLine("Background music:" + My.Settings.Hintergrundmusik.ToString)
            strW.WriteLine("Gamemode:" + My.Settings.CommanderWarsGameMoodus.ToString)
            strW.WriteLine("Windowed:" + My.Settings.Fenstermodus.ToString)
            strW.WriteLine("Fullscreen Width:" + My.Settings.StandardVollbildschirmBreite.ToString)
            strW.WriteLine("Fullscreen Height:" + My.Settings.StandardVollbildschirmHöhe.ToString)
            strW.WriteLine("Terrain style:" + My.Settings.TerrainStyle.ToString)
            strW.WriteLine("CoListAW:" + My.Settings.COListAW.ToString)
            strW.WriteLine("CoListAW2:" + My.Settings.COListAW2.ToString)
            strW.WriteLine("CoListAWDC:" + My.Settings.COListAWDC.ToString)
            strW.WriteLine("CoListAWDS:" + My.Settings.COListAWDS.ToString)
            strW.WriteLine("CoListCoW:" + My.Settings.COListCoW.ToString)
            strW.WriteLine("//Custom Unit Lists")
            strW.WriteLine("Unit List1:" + My.Settings.EinheitenListe1.ToString)
            strW.WriteLine("Unit List2:" + My.Settings.EinheitenListe2.ToString)
            strW.WriteLine("Unit List3:" + My.Settings.EinheitenListe3.ToString)
            strW.WriteLine("//You can record your game and view it afterwards")
            strW.WriteLine("Record:" + My.Settings.Aufzeichnen.ToString)
            strW.WriteLine("InfoMenu:" + My.Settings.InfoMenü.ToString)
            strW.WriteLine("AutoResizeWindow:" + My.Settings.AutoResizeWindow.ToString)
            strW.WriteLine("Taskbarmode:" + My.Settings.TaskAnzeigenModus.ToString)
            'Script-Writer:
            strW.WriteLine("")
            strW.WriteLine("//Script-Writer")
            strW.WriteLine("Script-Writer Size:" + My.Settings.Größe.Width.ToString + ";" + My.Settings.Größe.Height.ToString)
            strW.WriteLine("ShowInvalidCode:" + My.Settings.ShowInvalidCode.ToString)
            '3D:
            strW.WriteLine("")
            strW.WriteLine("//3D")
            strW.WriteLine("//the quality of the pictures")
            strW.WriteLine("Quality:" + My.Settings.TexturQuali.ToString)
            strW.WriteLine("//decides weather the game is displayed 3D or 2D")
            strW.WriteLine("3D:" + My.Settings.draw3D.ToString)
            strW.WriteLine("//make all units and buildings totally coloured in the colour of the player")
            strW.WriteLine("Paint everything:" + My.Settings.TotalEinfärben.ToString)
            strW.WriteLine("//This has no effect at the moment")
            strW.WriteLine("Mouselighting:" + My.Settings.Lichtmaus.ToString)
            strW.WriteLine("Animation Speed 3D:" + My.Settings.AnimGeschw3D.ToString)
            strW.WriteLine("Fog 3D:" + My.Settings.Kriegsnebel3D.ToString)
            'Tasten:
            strW.WriteLine("")
            strW.WriteLine("")
            strW.WriteLine("//Keys")
            strW.WriteLine("Key Up:" + My.Settings.Oben.ToString)
            strW.WriteLine("Key Down:" + My.Settings.Unten.ToString)
            strW.WriteLine("Key Right:" + My.Settings.Rechts.ToString)
            strW.WriteLine("Key Left:" + My.Settings.Links.ToString)
            strW.WriteLine("")
            strW.WriteLine("Key Confirm:" + My.Settings.Bestätigen.ToString)
            strW.WriteLine("Key Cancel:" + My.Settings.Abrechen.ToString)
            strW.WriteLine("")
            strW.WriteLine("Key Next:" + My.Settings.NächsteEinheit.ToString)
            strW.WriteLine("Key Select:" + My.Settings.SelectTaste.ToString)
            strW.WriteLine("Key change Battlefield:" + My.Settings.Schlachtwechsel.ToString)
            strW.WriteLine("")
            strW.WriteLine("Key Quicksave1:" + My.Settings.Quicksave1.ToString)
            strW.WriteLine("Key Quicksave2:" + My.Settings.Quicksave2.ToString)
            strW.WriteLine("Key Quickload1:" + My.Settings.Quickload1.ToString)
            strW.WriteLine("Key Quickload2:" + My.Settings.Quickload2.ToString)
            strW.WriteLine("")
            strW.WriteLine("Key Chat:" + My.Settings.Chat.ToString)
            strW.WriteLine("Key TeamChat:" + My.Settings.TChat.ToString)
        End Using
    End Sub


    Private Sub frmSplashScreen_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown, btnCoWStarten.KeyDown, btnScriptEditor.KeyDown
        Select Case e.KeyCode
            
        End Select
    End Sub
    'TODO: Dieses Formular kann einfach als Begrüßungsbildschirm für die Anwendung festgelegt werden, indem Sie zur Registerkarte "Anwendung"
    '  des Projekt-Designers wechseln (Menü "Projekt", Option "Eigenschaften").


    Private Sub frmSplashScreen_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        MySettingsIniLoad()
        'Richten Sie den Dialogtext zur Laufzeit gemäß den Assemblyinformationen der Anwendung ein.  
        SplScreen = Me
        'TODO: Passen Sie die Assemblyinformationen der Anwendung im Bereich "Anwendung" des Dialogfelds für die 
        '  Projekteigenschaften (im Menü "Projekt") an.

        'Anwendungstitel
        If My.Application.Info.Title <> "" Then
            ApplicationTitle.Text = My.Application.Info.Title
        Else
            'Wenn der Anwendungstitel fehlt, Anwendungsnamen ohne Erweiterung verwenden
            ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If

        'Verwenden Sie zum Formatieren der Versionsinformationen den Text, der zur Entwurfszeit in der Versionskontrolle festgelegt wurde, als
        '  Formatierungszeichenfolge. Dies ermöglicht ggf. eine effektive Lokalisierung.
        '  Build- und Revisionsinformationen können durch Verwendung des folgenden Codes und durch Ändern 
        '  des Entwurfszeittexts der Versionskontrolle in "Version {0}.{1:00}.{2}.{3}" oder einen ähnlichen Text eingeschlossen werden. Weitere Informationen erhalten Sie unter
        '  String.Format() in der Hilfe.
        '
        '    Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

        ' lblVersion.Text = System.String.Format(lblVersion.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)
        lblVersion.Text = "Version: " + My.Application.Info.Version.ToString

        'Copyrightinformationen
        ' Copyright.Text = My.Application.Info.Copyright
        Select Case My.Settings.Sprache
            Case Sprachen.Deutsch
                btnCoWStarten.Text = btnCoWStarten.Text + " Starten"
                btnScriptEditor.Text = btnScriptEditor.Text + " Starten"
            Case Sprachen.English
                btnCoWStarten.Text = "Launch " + btnCoWStarten.Text
                btnScriptEditor.Text = "Launch " + btnScriptEditor.Text
        End Select

        Dim Dat As String = Environment.CommandLine.ToLowerInvariant.ToLower
        If Dat.Contains("-Editor".ToLowerInvariant.ToLower) Or Dat.Contains("Editor.exe".ToLowerInvariant.ToLower) Then
            startenSE()
        ElseIf Dat.Contains("-Game".ToLowerInvariant.ToLower) Or Dat.Contains("Game.exe".ToLowerInvariant.ToLower) Then
            StartenCW()
        End If
        '  Hauptmenü.CreateMask("C:\Programmierung\Commander Wars\Programm\Schwarze Geschütz+O.PNG")
    End Sub

  

    Private Sub btnCoWStarten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCoWStarten.Click
        StartenCW()
    End Sub

    Private Sub btnScriptEditor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScriptEditor.Click
        startenSE()
    End Sub

    Sub StartenCW()
        Gestartet()

        Dim S As New Hauptmenü
        S.LoadForm()
    End Sub
    Sub startenSE()
        Gestartet()
        Dim S As New frmScriptWriter
        S.Show()
    End Sub
    Sub Gestartet()
        btnCoWStarten.Visible = False
        btnScriptEditor.Visible = False
    End Sub


    Private Sub btnHilfe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHilfe.Click
        MsgBox("Thats no big help file! But if CoW worked, and now you did something at the settings and now the game doesn't run anymore. (once I had the problem, that the Window was that little, that I couldn't change it in the option menu!) just run CoW with the parameter ""Reset"", or to reset and set everything to low quality, window mode, no music etc. ""ResetX"" If you don't know how to do that, just rename the ""CommanderWars.exe"" in ""Reset.exe"" or ""ResetX.exe"" this will work too.", MsgBoxStyle.Information, "how to reset settings")
    End Sub
End Class
